BlueCielo Meridian Enterprise 2012 Developer's Guide | BlueCielo ECM Solutions

IAMEdmUICache interface

This interface implements functionality required to access the content of a document stored in the vault.

Members (IAMEdmUICache)
Name Description

Empty property

True if the document is empty.

IsAmfs property

True unless local workspace is used.

Location property

The file system path where the document is stored. See Remarks.

Status property

The state of the document in the Local Workspace compared with the vault. See Remarks.

Sync method

Synchronizes the document in the Local Workspace with the vault. See Remarks.

Members (IAMEdmUICache2)
Name Description

GetLockInfo method

Returns the AMLOCKTYPE

SetLock method

Locks/unlocks a document

ShowStatus method

Displays Conflict dialog if required

Remarks

When AMFS is used to access documents in the vault, then the Location property returns the path to the document on the AMFS share. This path can be used to read/write the document or open it in an application.

When Local Workspace is used, the same Location property will return the path of the document in the Local Workspace folder. It will automatically ensure the correct revision of the document is available.

The Status property will return an AMUICACHESYNCTYPES constants value that describes the state of the document in the Local Workspace. For AMFS this value is always AMUICACHE_DONOTHING.

Following is a table of the possible lock types:

AMLOCKTYPE constants
Name Description

AMLT_NOLOCK

Unlocked

AMLT_OTHERLOCK

Locked on other computer

AMLT_OTHERUSER

Locked by other user

AMLT_THIS

Locked locally

AMLT_BRCLOCK

Locked in briefcase

AMLT_BRCUSER

Locked in briefcase by another user

AMLT_GCFLOCK

Locked at another site by the Global Collaboration Framework

The sample code below demonstrates how to access documents from code. The GetDocumentPath method returns the path where the document can be found. This will work for both AMFS and Local Workspace.

The SetDocumentLock(doc, True)method will make the document writable (assuming it is a working copy or Under Change).

Related information

AMDocumentUI object

IAMEdmItemsUIPersist interface

Example
Public Function GetDocumentPath(doc As AMDocument) As String
    GetDocumentPath = ""
    
    If Not doc Is Nothing Then
        'Create AMDocumentUI and take IAMEdmUICache interface
        Dim DocLocation As IAMEdmUICache
        Set DocLocation = New AMDocumentUI
    
        'Take IAMEdmUIPersist interface from AMDocumentUI
        Dim Persist As IAMEdmUIPersist
        Set Persist = DocLocation
    
        'Initialize AMDocumentUI object with AMDocument
        Persist.Init doc
    
        'Take IAMEdmUICache interface from AMDocumentUI object
        GetDocumentPath = DocLocation.Location(AMUICACHE_DEFAULT)
      
        Set DocLocation = Nothing
        Set Persist = Nothing
    End If
    
End Function
  
Public Sub SetDocumentLock(doc As AMDocument, bLock As Boolean)
    
    If Not doc Is Nothing Then
        'Create AMDocumentUI and take IAMEdmUICache interface
        Dim DocLocation As IAMEdmUICache2
        Set DocLocation = New AMDocumentUI
        
        'Take IAMEdmUIPersist interface from AMDocumentUI object
        Dim Persist As IAMEdmUIPersist
        Set Persist = DocLocation
    
        'Initialize AMDocumentUI object with AMDocument
        Persist.Init doc
    
        If bLock Then
            ' No locking required for AMFS
            If Not DocLocation.IsAmfs Then
                ' Lock the document.
                ' The document in the Local Workspace will be updated and made writable
                DocLocation.SetLock AMLT_THIS
            End If
        Else
            ' Unlock the document.
            DocLocation.SetLock AMLT_NOLOCK
        End If
      
        Set DocLocation = Nothing
        Set Persist = Nothing
    End If
    
End Sub

Copyright © 2000-2012 BlueCielo ECM Solutions